package com.baseproject.datasource.get.response;

import org.json.JSONArray;
import org.json.JSONObject;

/**
 * Created by hp on 2017/9/5.
 */

public abstract class BaseResponseHandler {

     public static BaseResponseHandler createResponseHandler(Object dataObject) {
          if (dataObject instanceof JSONArray) {
              return new JSONArrayHandler((JSONArray) dataObject);
          } else if (dataObject instanceof JSONObject) {
              return new JSONObjectHandler((JSONObject) dataObject);
          }
          return null;
     }

     public abstract JSONArray getJSONArrayData();

     public abstract JSONObject getJSONObjectData();

}
